package com.neu.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.neu.common.to.mq.SeckillOrderTo;
import com.neu.common.utils.PageUtils;
import com.neu.gulimall.order.entity.OrderEntity;
import com.neu.gulimall.order.vo.*;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author yzh
 * @email 643488468@qq.com
 * @date 2022-05-27 18:17:18
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 返回订单确认页所需要的信息
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单
     * @param vo
     * @return
     */
    OrderSubmitResponseVo submitOrder(OrderSubmitVo vo);

    /**
     * 根据订单号获取订单实体
     * @param orderSn
     * @return
     */
    OrderEntity getOrderStatus(String orderSn);

    /**
     * 关闭订单
     * @param orderEntity
     */
    void closeOrder(OrderEntity orderEntity);

    /**
     * 获取当前订单的支付信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPayVo(String orderSn);

    /**
     * 根据当前登录的用户id来查询其所有订单信息
     * @return
     */
    List<OrderEntity> queryPageWithItem();

    String handlePayResult(PayAsyncVo asyncVo);

    void createSeckillOrder(SeckillOrderTo orderTo);
}

